///*
// * Backup.h
// *
// *  Created on: 04-05-2013
// *      Author: Skeith
// */
//
//#ifndef BACKUP_H_
//#define BACKUP_H_
//
//cv::CascadeClassifier face("haarcascades\\haarcascade_frontalface_default.xml");
//	cv::CascadeClassifier eyes("haarcascades\\haarcascade_eye.xml");
//	cv::CascadeClassifier nose("haarcascades\\haarcascade_mcs_nose.xml");
//	cv::CascadeClassifier mouth("haarcascades\\haarcascade_mcs_mouth.xml");
//	//cv::CascadeClassifier leftEye("haarcascades\\haarcascade_mcs_lefteye.xml");
//	//cv::CascadeClassifier rightEye("haarcascades\\haarcascade_mcs_righteye.xml");
//
//	std::vector<cv::Rect> faceROI;
//	std::vector<cv::Rect> eyesROI;
//	std::vector<cv::Rect> noseROI;
//	std::vector<cv::Rect> mouthROI;
//	std::vector<cv::Rect> leftEyeROI;
//	std::vector<cv::Rect> rightEyeROI;
//
//	face.detectMultiScale(m, faceROI, 1.1, 2, 0 | CV_HAAR_SCALE_IMAGE | CV_HAAR_FIND_BIGGEST_OBJECT);
//
//	cv::Mat faceImg;
//	m(faceROI.at(0)).copyTo(faceImg);
//
//	//Face divide
//	int third = faceImg.rows / 3;
//	cv::Rect upper(0, third - third / 3, faceImg.cols, third);
//	cv::Rect middle(0, third + third / 3, faceImg.cols, third);
//	cv::Rect lower(0, third * 2, faceImg.cols, third);
//	//----------------------------------------------------//
//
//	//Features detection
//	cv::Mat m1;
//	cv::Mat m2;
//	cv::Mat m3;
//	faceImg(upper).copyTo(m1);
//	faceImg(lower).copyTo(m2);
//	faceImg(middle).copyTo(m3);
//
//	eyes.detectMultiScale(m1, eyesROI, 1.2, 4, 0 | CV_HAAR_SCALE_IMAGE | CV_HAAR_FEATURE_MAX);
//	nose.detectMultiScale(m3, noseROI, 1.1, 2, 0 | CV_HAAR_SCALE_IMAGE | CV_HAAR_FIND_BIGGEST_OBJECT);
//	mouth.detectMultiScale(m2, mouthROI, 1.2, 2, 0 | CV_HAAR_SCALE_IMAGE | CV_HAAR_FEATURE_MAX | CV_HAAR_FIND_BIGGEST_OBJECT);
//
////	drawRect(m3, noseROI, cv::Scalar(255, 0, 0));
////	drawRect(m1, eyesROI, cv::Scalar(255, 0, 0));
////	drawRect(m2, mouthROI, cv::Scalar(255, 0, 0));
//
//	//------------------------------------//
//
//	cv::Mat eye1;
//	cv::Mat eye2;
//
//	eyesROI.at(0).x -= 10;
//	eyesROI.at(1).x -= 10;
//	eyesROI.at(0).width += 20;
//	eyesROI.at(1).width += 20;
//	m1(eyesROI.at(0)).copyTo(eye1);
//	m1(eyesROI.at(1)).copyTo(eye2);
//
//	cv::Mat element = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(2 * 5 + 1, 2 * 5 + 1), cv::Point(5, 5));
//
//	cv::erode(eye1, eye1, element);
//	cv::erode(eye2, eye2, element);
//
//	cv::threshold(eye1, eye1, 128, 255, cv::THRESH_BINARY);
//	cv::threshold(eye2, eye2, 128, 255, cv::THRESH_BINARY);
//
//	//cv::GaussianBlur(eye1, eye1, cv::Size(9, 9), 2, 1);
//	//cv::GaussianBlur(eye2, eye2, cv::Size(9, 9), 2, 1);
//
//	std::vector<cv::Vec3f> circles;
//
////	cv::HoughCircles(eye1, circles, CV_HOUGH_GRADIENT, 1, eye1.rows / 8, 30, 20, 0, 0);
////	for (size_t i = 0; i < circles.size(); i++) {
////		cv::Point center(cvRound (circles[i][0]), cvRound (circles[i][1]));
////		int radius = cvRound(circles[i][2]);
////		// circle center
////		cv::circle(eye1, center, 3, cv::Scalar(255, 0, 0), 1, 2, 0);
////		// circle outline
////		cv::circle(eye1, center, radius, cv::Scalar(255, 0, 0), 1, 2, 0);
////	}
////
////	cv::HoughCircles(eye2, circles, CV_HOUGH_GRADIENT, 1, eye2.rows / 8, 30, 20, 0, 0);
////	for (size_t i = 0; i < circles.size(); i++) {
////		cv::Point center(cvRound (circles[i][0]), cvRound (circles[i][1]));
////		int radius = cvRound(circles[i][2]);
////		// circle center
////		cv::circle(eye2, center, 3, cv::Scalar(255, 0, 0), 1, 1, 0);
////		// circle outline
////		cv::circle(eye2, center, radius, cv::Scalar(255, 0, 0), 1, 1, 0);
////	}
//
//	cv::imshow("upper", m1);
//	cv::imshow("lower", m2);
//	cv::imshow("middle", m3);
//
//	cv::imshow("eye1", eye1);
//	cv::imshow("eye2", eye2);
//	cv::imshow("m", faceImg);
//
//
//#endif /* BACKUP_H_ */
